﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HML.Demo
{
    /// <summary>
    /// 视图窗口
    /// </summary>
    public class ItemFormTemplate : Form, IItemFormTemplate
    {
        public ItemFormTemplate()
        {
            this.ViewStatus = ItemFormTemplateStatus.Create;
        }

        #region 实现

        public bool ViewVisible { get; set; }

        public ItemFormTemplateStatus ViewStatus { get; set; }

        public virtual ItemFormTemplateViewObject AsynchRequestTask(ItemFormTemplateViewObject view)
        {
            return view;
        }

        public virtual void DataBind(ItemFormTemplateViewObject view)
        {

        }

        public virtual void ShowView()
        {
            if (this.ViewVisible)
                return;

            this.ViewVisible = true;
        }

        public virtual void HideView()
        {
            if (!this.ViewVisible)
                return;

            this.ViewVisible = false;

        }

        public virtual void CloseView()
        {

        }

        #endregion

    }

}
